package com.hyb.page;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageReq implements Serializable {

    /**
     * 每页返回的数据
     */
    private Object myData;

    /**
     * 每页显示大小
     */
    private long  size;

    /**
     * 当前页码
     */
    private  long current;

    /**
     * 最大页数
     */
    private  long maxCurrent;

    /**
     * 数据总条数
     */
    private  long total;


    public long getMaxCurrent() {
        return maxCurrent;
    }

    public void setMaxCurrent(long maxCurrent) {
        this.maxCurrent = maxCurrent;
    }

//    public void setTotal(long total) {
//        if(size != 0){
//            if(total % size != 0){
//                maxCurrent = total / size + 1;
//            }else {
//                maxCurrent = total / size;
//            }
//        }
//    }

    public PageReq() {

    }

    public PageReq(long size, long current, long total) {
        this.size = size;
        this.current = current;
        this.total = total;
        setTotal(total);
    }
}
